<?php /* Smarty version Smarty-3.1.14, created on 2017-08-25 11:46:36
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\attribute.html" */ ?>
<?php /*%%SmartyHeaderCode:15018599f9d9c5e8269-96454152%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '6ff2d52aff3fa7cb65dc1d2d3292cf05df377d24' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\attribute.html',
      1 => 1502508928,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '15018599f9d9c5e8269-96454152',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'goods_type' => 0,
    'info' => 0,
    'list' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_599f9d9c636813_12446844',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_599f9d9c636813_12446844')) {function content_599f9d9c636813_12446844($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style>
th{ text-align:left;}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>商品类型</h3>
    <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
      <a href="attribute.php?act=edit&goods_type=<?php echo $_smarty_tpl->tpl_vars['goods_type']->value;?>
">
        <h5 style="padding:10px;color:#fff;">添加属性</h5>
      </a>
    </div>
  </div>
</div>
<div class="fixed_bottom">
  <form method="post" action="" id="aspnetForm" name="form1">
    <table align="center;" class="table tb-type2">
      <thead>
        <tr>
          <th width="50"><a>编号</a></th>
          <th width="25%"><a>属性名称</a></th>
          <th><a>商品类型</a></th>
          <th><a>可选值列表</a></th>
          <th><a>排序</a></th>
          <th width="10%"><a>操作</a></th>
        </tr>
      </thead>
      <tbody>
      	<?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['info']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
?>
      	<tr class="par_<?php echo $_smarty_tpl->tpl_vars['list']->value['parent_id'];?>
">
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['attr_id'];?>
</td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['attr_name'];?>
</td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['cat_name'];?>
</td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['attr_values'];?>
</td>
          <td><?php echo $_smarty_tpl->tpl_vars['list']->value['sort_order'];?>
</td>
          <td><a href="attribute.php?act=edit&id=<?php echo $_smarty_tpl->tpl_vars['list']->value['attr_id'];?>
">编辑</a> | <span onclick="ajax_del(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['attr_id'];?>
)" style="cursor:pointer;">删除</span></td>
        </tr>
        <?php } ?>
      
    </table>
  </form>
</div>
</body>
<script>
//删除属性
function ajax_del(obj,id){
    $.post("attribute.php",{act:'del_judge',attr_id:id},function(data){
        if(data>0){
              var msg = "已经有"+data+"个商品使用该属性，您确实要删除该属性吗？";
        }else{
              var msg = "您确实要删除该属性吗？";
        }
        layer.confirm(msg, {
        btn: ['确认','取消'] //按钮
        }, function(){
            $.post("attribute.php",{act:'ajax_del',attr_id:id},function(data){
                if(data==1){
                    $(obj).parent().parent().remove();
                    layer.msg("操作成功! ");
                }else if(data==2){
                    layer.msg("操作失败! ");
                }
            });     
        }, function(){
           layer.msg('明白了', {
           time: 1000//20s后自动关闭
        });
    });
      });
}
</script>
</html><?php }} ?>